package com.chinatelecom.otms.circuitcheck.dao;

import com.chinatelecom.otms.circuitcheck.entity.CheckCircuit;
import com.chinatelecom.otms.circuitcheck.entity.SncRoute;
import com.chinatelecom.otms.circuitcheck.mapper.SncRouteMapper;
import com.chinatelecom.otms.circuitcheck.util.Common;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class SncRouteDao {

    @Autowired
    private SncRouteMapper sncRouteMapper;

    public Map<String, List<SncRoute>> getSncRouteListsBySncIdAndWayType(List<CheckCircuit> list) throws NoSuchFieldException, IllegalAccessException {
        List<SncRoute> sncRouteList = sncRouteMapper.getSncRouteListsBySncIdAndWayType(list);
        return new Common<SncRoute>().classifyListByStringParams(sncRouteList, "snc_id");
    }
}
